package com.dhcc.DRGsHosp.web.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.openkoala.koala.commons.InvokeResult;
import org.openkoala.security.shiro.CurrentUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dhcc.DRGsHosp.facade.DepCliMonitorFacade;
import com.dhcc.DRGsHosp.facade.dto.IndexCalDTO;
import com.dhcc.DRGsHosp.infra.util.StringUtils;

@Controller("drgsHospWebController6")
@RequestMapping("/DepCliMonitor")
public class DepCliMonitorContorller {

	@Autowired
	private DepCliMonitorFacade depCliMonitorFacade;
	/**
	 * @methodname    :getRoleName
	 * @description   :获取科室code及科室name 
	 * @param         :
	 * @author        :sulina
	 * @return        :
	 * @date          :2015年5月13日
	 */
	@ResponseBody
	@RequestMapping(value = "/getRoleName", method = RequestMethod.POST)
	public Map getRoleName() {
		Map<String, Object> map = new HashMap<String, Object>();
		String roleName = CurrentUser.getRoleName();
		String depCode = CurrentUser.getDeps();
		map.put("roleName", roleName);
		map.put("depCode", depCode);

		return map;
	}
	
    /**
     * 
     * @methodname    :getDepGroupCodeByDep
     * @description   :根据科室信息获取科室组信息
     * @param         :
     * @author        :sulina
     * @return        :
     * @date          :2015年5月13日
     */
    @ResponseBody
    @RequestMapping(value = "/getDepGroupCodeByDep", method = RequestMethod.POST)
    public Map<String, Object> getDepGroupCodeByDep(IndexCalDTO dto) {
    	return depCliMonitorFacade.getDepGroupCodeByDep(dto);
    }
    
    /**
     * 
     * @methodname    :getDepGroupName
     * @description   :获取科室组名称
     * @param         :
     * @author        :sulina
     * @return        :
     * @date        
     *   :2015年5月13日
     */
    @ResponseBody
    @RequestMapping(value = "/getDepGroupName", method = RequestMethod.POST)
    public Map<String, Object> getDepGroupName(IndexCalDTO dto) {
    	return depCliMonitorFacade.getDepGroupName(dto);
    }
    
	/**
	 * @methodname    :getDepGroupSum
	 * @description   :获取科室组汇总信息
	 * @param         :
	 * @author        :shaozhiyuan
	 * @return        :
	 * @date          :2018年2月7日
	 */
	@ResponseBody
	@RequestMapping(value = "/getDepGroupSum", method = RequestMethod.POST)
	public InvokeResult getDepGroupSum(IndexCalDTO dto) {
		String depCode=dto.getPardepCode();
		return InvokeResult.success(depCliMonitorFacade.getDepGroupSum(depCode));
	}
}
